package com.yike.user.controller;

import com.yike.user.entity.VersionControl;
import com.yike.user.param.VersionControlParam;
import com.yike.user.service.VersionControlService;
import com.yike.user.vo.VersionControlVo;
import lombok.extern.slf4j.Slf4j;
import com.yike.common.base.BaseController;
import com.yike.common.api.ApiResult;
import com.yike.common.log.Module;
import com.yike.common.log.OperationLog;
import com.yike.common.enums.OperationLogType;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 软件版本 控制器
 *
 * @author yike
 * @since 2024-07-25
 */
@Slf4j
@RestController
@RequestMapping("/versionControl")
@Module("user")
@Api(value = "软件版本API", tags = {"软件版本"})
public class VersionControlController extends BaseController {

    @Autowired
    private VersionControlService softVersionService;

    /**
     * 软件版本分页列表
     */
    @PostMapping("/getLatest")
    //@OperationLog(name = "最新版本", type = OperationLogType.INFO)
    @ApiOperation(value = "最新版本", response = VersionControlVo.class)
    public ApiResult<VersionControlVo> getLatest(@RequestBody VersionControlParam versionControlParam) {
        VersionControlVo softVersion = softVersionService.getLatest(versionControlParam);
        return ApiResult.ok(softVersion);
    }

}

